/**
 * 合并对象
 * @param  {...any} objs
 */
export function mergeObject(...objs) {
  const result = {}

  objs.forEach((obj) => {
    Object.keys(obj).forEach((key) => {
      // eslint-disable-next-line
      if (!obj.hasOwnProperty(key)) {
        result[key] = obj[key]
      } else {
        result[key] = [].concat(result[key], obj[key])
      }
    })
  })

  return result
}
